Skip to content

Add support for substitution formatters in all HttpService uses#44007

Open
Retr0-XD wants to merge 1 commit intoenvoyproxy:mainfrom
Retr0-XD:add-substitution-formatters-support-squashed
Open

Add support for substitution formatters in all HttpService uses#44007
Retr0-XD wants to merge 1 commit intoenvoyproxy:mainfrom
Retr0-XD:add-substitution-formatters-support-squashed

Conversation

@Retr0-XD
Copy link

Summary

This change adds substitution formatter support to
equest_headers_to_add for HTTP service-based integrations that previously treated header values as static strings.

It introduces a shared helper, HttpServiceHeadersApplicator, and wires it into:

  • OpenTelemetry HTTP metrics exporter
  • Zipkin tracer HTTP collector path

As a result, configured headers can use formatter expressions and are evaluated at apply-time rather than only at construction-time.

Motivation

Some HTTP service configurations need dynamic header values. Existing code paths in these integrations only copied raw string values and did not support formatter evaluation.

What changed

  • Added HttpServiceHeadersApplicator:
    • source/common/http/http_service_headers.h
    • source/common/http/http_service_headers.cc
    • http_service_headers_lib in source/common/http/BUILD
  • Updated OpenTelemetry stat sink HTTP exporter to use the shared helper.
  • Updated Zipkin tracer HTTP collector path to use the shared helper.
  • Added required build deps in OpenTelemetry and Zipkin BUILD files.

Behavior

  • Static headers continue to work as before.
  • HttpService header values can now use substitution formatter expressions.
  • Formatter parse/setup errors fail initialization with a clear exception.

Testing

  • CI/build validation in PR.
  • Manual verification by configuring formatter expressions in
    equest_headers_to_add and checking resolved outbound headers.

@repokitteh-read-only
Copy link

Hi @Retr0-XD, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #44007 was opened by Retr0-XD.

see: more, trace.

@ggreenway
Copy link
Member

This requires #43803 to merge first.

/wait

@ggreenway ggreenway self-assigned this Mar 18, 2026
@kyessenov
Copy link
Contributor

Repo policy requires disclosure the use of AI tools. Can you update the description to conform to repo template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants